var async = require('async')

var task1 =function(m,callback){
  console.log("task1");
  setTimeout(function(){
    callback(null,m*2)
  },1000); 
}

var task2 =function(m,callback){
  console.log("task2");
  setTimeout(function(){
    callback(null,m+3)
  },1000);
}

var task3 =function(m,callback){
  console.log("task3");
  setTimeout(function(){
    callback(null,m*5)
  },1000);
}
console.time("compose方法");
var com = async.compose(task3,task2,task1);

com(2,function(err,result){
  if (err) {
    console.log(err);
  }
  console.log(result);
  console.timeEnd("compose方法");
})
